<?php include_once('../layouts/header.php') ?>
<div class="easyui-layout" data-options="fit:true">
    <div data-options="region:'center',split:true,border:false">
        <div class="container">
            <fieldset><legend><code>复选框 checkbox</code></legend></fieldset>
            <form id="form-checkbox"
             data-options="
                form:{
                    url:'/data/index.php?type=test',
                    id:'#form-checkbox',
                },
             ">
                <div class="form-box sm-form">
                    <?php 
                        $enjoys = [
                            'football'=>'足球',
                            'basketball'=>'篮球',
                            'book'=>'看书',
                            'music'=>'听音乐',
                            'games'=>'玩游戏',
                            'rugby'=>'橄榄球',
                            'runing'=>'跑步',
                            'climbing'=>'攀登',
                        ];
                     ?>
                    <div class="form-item row">
                        <div class="form-input col-12">
                            <label class="form-label"><span>爱好(原生)：</span></label>
                            <?php foreach ($enjoys as $en => $cn): ?>
                                <label class="form-label form-checkbox">
                                    <input type="checkbox" name="enjoysy[]" value="<?=$en ?>">
                                    <span class="checkbox-text"><?=$cn ?></span>
                                </label>
                            <?php endforeach ?>
                        </div>
                    </div>
                    <div class="form-item row">
                        <div class="form-input col-12">
                            <label class="form-label"><span>爱好(easyui)：</span></label>
                            <?php foreach ($enjoys as $en => $cn): ?>
                                <label class="form-label form-checkbox">
                                    <input class="easyui-checkbox" name="enjoys[]" data-options="label:'<?=$cn ?>',value:'<?=$en ?>'">
                                </label>
                             <?php endforeach ?>
                        </div>
                    </div>
                </div>
                <button type="button" class="btn btn-primary btn-block" onclick="$.submitForm(this)">保存</button>
            </form>
        </div>
    </div>
</div>

<?php include_once('../layouts/footer.php') ?>